package stream;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 并发流
 *
 * @author
 */
public class Test3 {
    public static void main(String[] args) {
        List<Domain> list = new ArrayList<>();

        Domain info = new Domain();
        info.setId("123");
        info.setName("塑料袋");

        Domain info1 = new Domain();
        info1.setId("234");
        info1.setName("sdfg");

        list.add(info);
        list.add(info1);


        list.parallelStream().forEach(a -> System.out.println(a.getId()));
        list.stream().parallel().peek(a -> System.out.println(a.getId())).collect(Collectors.toList());
    }
}
